package com.lovo.project2.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lovo.project2.bean.SuppilerBean;
import com.lovo.project2.mapper.ISuppilerBeanMapper;
import com.lovo.project2.service.ISuppilerBeanService;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class SuppilerBeanServiceImpl extends ServiceImpl<ISuppilerBeanMapper, SuppilerBean> implements ISuppilerBeanService {
    @Override
    public IPage<SuppilerBean> queryPageByItem(IPage iPage, String supName, String scope) {
        QueryWrapper queryWrapper=new QueryWrapper();
       if (supName!=null&&!"".equals(supName)){
           queryWrapper.like("name",supName);
       }
        if (scope!=null&&!"".equals(scope)){
            queryWrapper.like("scope",scope);
        }

 IPage<SuppilerBean> iPage1=  baseMapper.selectPage(iPage,queryWrapper);



        return iPage1;
    }

    @Override
    public SuppilerBean seleceSuppilerById(int id) {
        return null;
    }

    @Override
    public void updateSuppilerBean(SuppilerBean suppilerBean) {

        baseMapper.updateById(suppilerBean);

    }

    @Override
    public void addSuppilerBean(SuppilerBean suppilerBean) {

baseMapper.insert(suppilerBean);
    }

    @Override
    public void importSuppilerBean(List<SuppilerBean> suppilerBeans) {

    }

    @Override
    public List<SuppilerBean> queryAllSuppilerBean() {

        return  baseMapper.selectList(null) ;
    }
}
